import { useRoutes } from "react-router-dom";
import List from "../components/List";
import NotFund from "../components/404";
import Login from "../pages/Login";
import Main from '../pages/Main'
import About from "../pages/Main/about"
import Home from "../pages/Main/home";
const route = [
    {
        path : "/login",
        element :<Login/>
    },{
        path : "/main",
        element :<Main/>,
        children : [
            {
                path : "/main/about",
                element : <About/>
            },{
                path : "/main/home",
                element : <Home/>,
                children:[
                    {
                        path : '/main/home/news/:id',
                        element :  <List/>
                    },{
                        path : '/main/home/hobby/:id',
                        element :  <List/>
                    },
                ]
            },
        ]
    },{
        path : "/",
        element :<Login/>
    },{
        path : "/*",
        element :<NotFund/>
    },
]

export  const GetRoutes = () => {
    return useRoutes(route)
} 